package com.zx;

import com.zx.bean.AnnotationApplicationContext;
import com.zx.bean.ApplicationContext;
import com.zx.dao.UserDao;
import com.zx.service.UserService;

public class TestUser {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationApplicationContext("com.zx");
        UserService service = (UserService) context.getBean(UserService.class);
        System.out.println(service);
        service.add();

        /*
        执行结果：
        正在加载【interface com.zx.dao.UserDao】,实例对象是：com.zx.dao.impl.UserDaoImpl
        正在加载【interface com.zx.service.UserService】,实例对象是：com.zx.service.impl.UserServiceImpl
        正在给【com.zx.service.impl.UserServiceImpl】属性【userDao】注入值【com.zx.dao.impl.UserDaoImpl】
        com.zx.service.impl.UserServiceImpl@506e1b77
        service...
        dao...
         */


    }
}
